<!-- 添加手机号 -->
<div ng-if="pagedata.show_setmobile" class="popup" id="show_card">
<style>
.my_span {
      display: flex;
      width: 100%;
      height: 2.5rem;
}
.my_span span {
     flex: 1;
	 font-size:1.6rem;
	 padding-top:0;
     border: #ddd solid 1px;
	 margin:0 0.2rem;
}
.my_span span.hover,.my_span span:hover{
     border: #999 solid 1px;
}
.my_input{
	  position: absolute;
	  width:120%;
      height: 2.5rem;
      line-height: 2.5rem;
      top: 0.5rem;
      left: 0.6rem;
      background: none;
      overflow: hidden;
}
.my_input input{
		float: left;
		width: 120%;
        height: 2.5rem;
        line-height: 2.5rem; 
        margin-top: 0.2rem;
        letter-spacing: 1rem;
        background: none;
        text-indent: 0.95rem;
		font-size:2rem;
		caret-color: transparent;
		color: transparent;
}
.fui-cell-group .fui-cell:before {
		border-top: 0 solid #ebebeb;
}
</style>
	<div class="popup-body">
    <div class="popup-bottom" style="height:18rem;">
		<div class="weui_cells_title bold" style="padding:0 0.8rem;font-size:1.3rem;margin-top:0.5rem;margin-bottom:0;color:#000">{{pagedata.setmobile.step!=1?'绑定手机':'输入验证码'}}</div>
		<div ng-if="pagedata.setmobile.step!=1" class="weui_cells_title subtitle" style="padding:0 0.8rem;margin-top:-0.2rem;">为保障您的权益，请输入正确的手机号！</div>
		<div ng-if="pagedata.setmobile.step==1" class="weui_cells_title subtitle" style="padding:0 0.8rem;margin-top:0.6rem;">验证码已发送至</div>
		<div class="fui-cell-group fui-cell-click" style="padding:0 0.2rem;">
			<div ng-if="pagedata.setmobile.step==1" class="fui-cell" style="padding:0 0.6rem;padding-bottom:0.6rem;">
				<div class="fui-cell-info bold" style="color:#000;font-size:1rem;letter-spacing:0.3rem;">{{pagedata.setmobile.mobile || '15000000000'}}</div>
				<div class="fui-cell-remark noremark" style="font-size:0.8rem" ng-click="tool.mobile_code(pagedata.setmobile.mobile,'sms_code')" id="sms_code">获取验证码</div>
			</div>
			<div ng-if="pagedata.setmobile.step!=1" class="fui-cell">
				<div class="fui-cell-info">
					<div class="fui-cell-info"><input type="text" class='fui-input c' style="font-size:1.5rem;border-bottom: 1px solid #f2f2f2;letter-spacing:0.6rem;" placeholder="填入您的手机号" ng-model="pagedata.setmobile.mobile"/></div>
				</div>
			</div>
			<div ng-if="pagedata.setmobile.step==1" class="fui-cell">
				<div class="fui-cell-info c">
						<div class="my_span">
							<span class="hover">{{pagedata.setmobile.sms_code[0]}}</span>
							<span ng-class="{'hover':pagedata.setmobile.sms_code.length>1}">{{pagedata.setmobile.sms_code[1]}}</span>
							<span ng-class="{'hover':pagedata.setmobile.sms_code.length>2}">{{pagedata.setmobile.sms_code[2]}}</span>
							<span ng-class="{'hover':pagedata.setmobile.sms_code.length>3}">{{pagedata.setmobile.sms_code[3]}}</span>
							<span ng-class="{'hover':pagedata.setmobile.sms_code.length>4}">{{pagedata.setmobile.sms_code[4]}}</span>
							<span ng-class="{'hover':pagedata.setmobile.sms_code.length>5}">{{pagedata.setmobile.sms_code[5]}}</span>
						</div>
						<div class="my_input">
							<input id="setmobile_code" type="tel" onkeyup="scope.pagedata.onblur();" ng-model="pagedata.setmobile.sms_code" maxlength="6">
						</div>
				</div>
			</div>
		</div>
		<div class="fui-cell-group">
                <div class="fui-cell small ">
                    <div class="fui-cell-info">
                        <label class="checkbox-inline">
                            <input type="checkbox" value="1" ng-model="pagedata.setmobile.check" class="fui-checkbox-primary" id="agree" ng-checked="pagedata.setmobile.check==1"/> 我已经阅读并了解了<a id="btn-apply" ng-click="pagedata.show_xieyi=true;" style="color:#337ab7;">【{{pagedata.setmobile.xieyi_title || '客户隐私协议'}}】</a>。
                        </label>
                    </div>
                </div>
        </div>
		<button class="weui_btn weui_btn_primary" style="width: 80%;margin-top:2rem" ng-if="pagedata.setmobile.step!=1 && pagedata.setmobile.login_type>0" href='javascript:;' ng-click="pagedata.setmobilemobile_code();">获取验证码</button>
		<button class="weui_btn weui_btn_primary" style="width: 80%;margin-top:2rem" ng-if="pagedata.setmobile.step==1 || pagedata.setmobile.login_type==0" href='javascript:;' ng-click="post(pagedata.setmobile,'core/member.set/postmobile/')">确认提交</button>
		<i class="closed icon icon-cuowu" ng-click="pagedata.show_setmobile=false"></i>
	</div>
	</div>
	<div ng-include="sys_html('common/_xieyi',true)"></div>
	<script>
	scope.pagedata.setmobile={login_type:0,step:0,sms_code:'',code1:'',code2:'',code3:'',code4:'',code5:'',code6:''}
	scope.pagedata.getmobileset=function(){
		scope.get('core/member.set/getdata/',function(res){
			scope.pagedata.setmobile.login_type=res.register.login_type;
			scope.pagedata.setmobile.user_xieyi=res.register.user_xieyi;
			scope.pagedata.setmobile.xieyi_title=res.register.xieyi_title;
			scope.$evalAsync();
		});
	}
	if(scope.pagedata.show_setmobile){
		scope.pagedata.getmobileset();
	}
	scope.pagedata.setmobilemobile_code=function(){
		if(scope.pagedata.setmobile.user_xieyi && scope.pagedata.setmobile.check!=1){
			scope.message('请先阅读协议！');
			return false
		}
		scope.tool.mobile_code(scope.pagedata.setmobile.mobile,'sms_code',function(res){
			if(res=='success'){
				scope.pagedata.setmobile.step=1;
				scope.message('发送成功！');
				scope.$evalAsync();
			}
		});
	}
	scope.pagedata.onblur=function(){
			//console.log(scope.pagedata.setmobile.sms_code.length);
			if(scope.pagedata.setmobile.sms_code.length==6){
				scope.pagedata.setmobile.sms_code=scope.pagedata.setmobile.sms_code;
				document.getElementById('agree').focus();
				scope.$evalAsync();
			}
	}
	</script>
</div>